<?php



class AddressBookMapBuilder {

	
	const CLASS_NAME = 'lib.model.map.AddressBookMapBuilder';

	
	private $dbMap;

	
	public function isBuilt()
	{
		return ($this->dbMap !== null);
	}

	
	public function getDatabaseMap()
	{
		return $this->dbMap;
	}

	
	public function doBuild()
	{
		$this->dbMap = Propel::getDatabaseMap('propel');

		$tMap = $this->dbMap->addTable('address_book');
		$tMap->setPhpName('AddressBook');

		$tMap->setUseIdGenerator(true);

		$tMap->addPrimaryKey('ADDRESS_BOOK_ID', 'AddressBookId', 'int', CreoleTypes::INTEGER, true, null);

		$tMap->addForeignKey('CUSTOMERS_ID', 'CustomersId', 'int', CreoleTypes::INTEGER, 'customers', 'CUSTOMERS_ID', true, null);

		$tMap->addColumn('ENTRY_GENDER', 'EntryGender', 'string', CreoleTypes::CHAR, true, 1);

		$tMap->addColumn('ENTRY_COMPANY', 'EntryCompany', 'string', CreoleTypes::VARCHAR, false, 32);

		$tMap->addColumn('ENTRY_FIRSTNAME', 'EntryFirstname', 'string', CreoleTypes::VARCHAR, true, 32);

		$tMap->addColumn('ENTRY_LASTNAME', 'EntryLastname', 'string', CreoleTypes::VARCHAR, true, 32);

		$tMap->addColumn('ENTRY_STREET_ADDRESS', 'EntryStreetAddress', 'string', CreoleTypes::VARCHAR, true, 64);

		$tMap->addColumn('ENTRY_SUBURB', 'EntrySuburb', 'string', CreoleTypes::VARCHAR, false, 32);

		$tMap->addColumn('ENTRY_POSTCODE', 'EntryPostcode', 'string', CreoleTypes::VARCHAR, true, 10);

		$tMap->addColumn('ENTRY_CITY', 'EntryCity', 'string', CreoleTypes::VARCHAR, true, 32);

		$tMap->addColumn('ENTRY_STATE', 'EntryState', 'string', CreoleTypes::VARCHAR, false, 32);

		$tMap->addForeignKey('ENTRY_COUNTRY_ID', 'EntryCountryId', 'int', CreoleTypes::INTEGER, 'countries', 'COUNTRIES_ID', true, null);

		$tMap->addForeignKey('ENTRY_ZONE_ID', 'EntryZoneId', 'int', CreoleTypes::INTEGER, 'zones', 'ZONE_ID', true, null);

	} 
} 